home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 6 / CU Amiga Magazine's Super CD-ROM 06 (1996)(EMAP Images)(GB)(Track 1 of 4)[!][issue 1997-01].iso / imagine / extras / tools / isl3_0b6 / docs / isl.bnf < prev    next >
Text File  |  1995-01-30  |  8KB  |  366 lines

  1. ISL.BNF - Copyright (c) 1995 Grizzly Bear Labs, last modified 01-25-94
  2.  
  3. This file describes the BNF for ISL, the Imagine Staging Language.  BNF is
  4. Backus Naur Form, a formal method for describing the syntax of a language.
  5. It should be fairly clear from the BNF what is allowable and what is not.
  6. This is a non-trivial document - I suggest you use ISL.doc to get an idea
  7. of what ISL is and does and how it works, then play with the destage and
  8. restage programs, and only then attempt to grok the grammar.
  9.  
  10. restage and islobjs both handle the entire grammar.
  11.  
  12. Before diving into the BNF, here are some things which are not in the BNF
  13. which are true of the ISL grammar.  Feel free to ignore the regular
  14. expressions and references to flex - they are included for the advanced
  15. user and should not be needed to understand the language.
  16.  
  17. 1)  Whitespace is optional.  You may have an entire stage on one line, or
  18.     may start a new line between any two keywords.  
  19.  
  20. 2)  STRING is a set of characters which is delimited by double quotes.
  21.     A legal string may contain 0 or more of any characters except for
  22.     the double quotes, since it is delimited by double quotes.
  23.  
  24. 3)  U32 is a token which contains one or more digits.  It may not have
  25.     a decimal point nor a sign.  {DIGIT}+ is the flex pattern used.
  26.  
  27. 4)  FLOAT is a token which contains an optional minus sign, one or more
  28.     digits, a period, and zero or more digits.  \-?{DIGIT}+\.{DIGIT}*
  29.     is the flex pattern used.  
  30.  
  31. 5)  I have not attempted to spell out the meaning of each U32, FLOAT, and
  32.     STRING, on the theory that their meanings should be obvious based on
  33.     their position in the grammar.  For example, in camerahdr, defined
  34.     as CAMERA STRING LAYER U32, you have one keyword (CAMERA), the name
  35.     (STRING), and a second keyword (LAYER) with the layer number (U32).
  36.     In this case, STRING would be the name of the CAMERA from the first
  37.     column of the Action editor.  A typical value for this clause would
  38.     be CAMERA "CAMERA" LAYER 0.
  39.  
  40. 6)  : means definition, | provides alternates.  Eh?  Take the very first
  41.     part of the BNF for an example.  A stage may consist of a stagehdr
  42.     OR a stagehdr followed by a camera followed by globals followed by
  43.     objects.  These, in turn, are defined individually.
  44.  
  45. 7)  Optional clauses contain an empty : clause followed by one or more
  46.     | clauses.  An example would be shadowflag which is either :
  47.     (nothing) or SHADOW.  The grammar is riddled with these, so make
  48.     sure you get it.  A stage may have zero or more objects, each of which
  49.     may have one or more positions, one or more alignments, etc.
  50.  
  51. 8)  File paths are stripped from file names by starting at the end of the
  52.     string, and scanning backwards until either a \ or a / has been found.
  53.     There are two possible subtle problems with this.  One, if you have a
  54.     PC stage and a / in your file name or an Amiga stage and a \ in your
  55.     file name, truncation will occur.  Two, ISL will not properly handle
  56.     files located in a root directory or symbolic link unless they have a
  57.     / or a \ in their path.  Effect file names are case insensitive.
  58.  
  59. Finally, here's the BNF:
  60.  
  61. stage
  62.     : stagehdr
  63.     | stagehdr camera globals objects
  64.  
  65. stagehdr
  66.     : STAGE MAXFRAMES U32 LOOP U32
  67.  
  68. camera
  69.     : camerahdr positions alignments sizes assocs effects
  70.  
  71. camerahdr
  72.     : CAMERA STRING LAYER U32
  73.  
  74. globals
  75.     : globalhdr globalchunks positions alignments sizes
  76.  
  77. globalhdr
  78.     : GLOBALS STRING LAYER U32
  79.  
  80. globalchunks
  81.     :
  82.     | globalchunks globalchunk
  83.  
  84. globalchunk
  85.     : ACTOR frames
  86.       BRUSH STRING U32
  87.       BACKDROP STRING U32
  88.       AMBIENT rgb HORIZON rgb +ZENITH rgb -ZENITH rgb
  89.       FOG btl FOG rgb
  90.       STARFIELD FLOAT TRANSITION U32
  91.  
  92. objects
  93.     :
  94.     | objects object
  95.  
  96. object
  97.     : objecthdr fil3chunks positions alignments sizes assocs effects
  98.     | lighthdr lit2chunks positions alignments sizes assocs
  99.     | axishdr axischunks positions alignments sizes assocs
  100.  
  101. objecthdr
  102.     : OBJECT STRING LAYER U32 quickdrawflag
  103.  
  104. lighthdr
  105.     : LIGHT STRING LAYER U32 quickdrawflag
  106.  
  107. axishdr
  108.     : AXIS STRING LAYER U32 quickdrawflag
  109.  
  110. positions
  111.     :
  112.     | positions pos2chunk
  113.     | positions pth2chunk
  114.  
  115. pos2chunk
  116.     : POSITION frames xyz v0v1 splineflag knotflag
  117.  
  118. pth2chunk
  119.     : POSITION frames PATH STRING ACCEL U32 FLOAT DECEL U32 FLOAT
  120.  
  121. alignments
  122.     :
  123.     | alignments aln2chunk
  124.     | alignments palnchunk
  125.     | alignments talnchunk
  126.  
  127. aln2chunk
  128.     : ALIGN frames xyz v0v1 splineflag knotflag
  129.  
  130. palnchunk
  131.     : ALIGN frames PATH yhorizontalflag gconformflag oconformflag
  132.  
  133. talnchunk
  134.     : ALIGN frames OBJECT STRING YROT FLOAT FLOAT
  135.  
  136. sizes
  137.     :
  138.     | sizes osz2chunk
  139.  
  140. osz2chunk
  141.     : SIZE frames xyz v0v1 splineflag knotflag
  142.  
  143. fil3chunks
  144.     :
  145.     | fil3chunks fil3chunk
  146.  
  147. fil3chunk
  148.     : ACTOR frames NAME STRING STATE STRING CYCLE FLOAT FLOAT reverseflag v0v1 splineflag knotflag
  149.  
  150. lit2chunks
  151.     :
  152.     | lit2chunks lit2chunk
  153.  
  154. lit2chunk
  155.     : ACTOR frames ppshape rrshape shadowflag diminishflag rgb TRANSITION U32 flareflag
  156.  
  157. axischunks
  158.     :
  159.     | axischunks axischunk
  160.  
  161. axischunk
  162.     : ACTOR frames
  163.  
  164. assocs
  165.     :
  166.     | assocs asscchunk
  167.  
  168. asscchunk
  169.     : ASSOC frames OBJECT STRING
  170.  
  171. effects
  172.     :
  173.     | effects effect
  174.  
  175. effect
  176.     : EFFECT U32 frames Baloon STRING
  177.       radiustype FLOAT reverseflag returnflag
  178.     | EFFECT U32 frames Boing20 STRING
  179.       xyzaxis ucdsquash SHRINK FLOAT TIMES U32
  180.     | EFFECT U32 frames Boing2 STRING
  181.       xyzaxis ucdsquash SHRINK FLOAT TIMES U32
  182.     | EFFECT U32 frames Explode STRING
  183.       srlshape xyzaxis EXPLOSION FLOAT FLOAT SCALING FLOAT
  184.       ROTATIONS FLOAT FLOAT SEED U32
  185.       returnflag reverseflag
  186.     | EFFECT U32 frames Firewrks STRING
  187.       srlshape xyzaxis EXPLOSION FLOAT FLOAT SCALING FLOAT
  188.       ROTATIONS FLOAT FLOAT EXPANSION FLOAT DISTANCE FLOAT SEED U32
  189.       sparkleflag
  190.     | EFFECT U32 frames Flash STRING
  191.       ON U32 OFF U32 startflag
  192.     | EFFECT U32 frames Grow STRING
  193.       YROT FLOAT XSCALE FLOAT
  194.       ZSCALE FLOAT XTRANS FLOAT ZTRANS FLOAT
  195.       alignyflag keepxflag mirrorflag reverseflag sharpflag
  196.     | EFFECT U32 frames Particle STRING
  197.       dreflag bounceflag taperflag reverseflag returnflag
  198.       TRAVEL FLOAT SCALING FLOAT FLOAT ROTATIONS FLOAT FLOAT HTIME FLOAT 
  199.       GRAVITY FLOAT SEED U32 ELASTICITY FLOAT ZTIME FLOAT ZGROUND FLOAT
  200.       SPEED FLOAT ZANGLE FLOAT FLOAT XANGLE FLOAT FLOAT
  201.     | EFFECT U32 frames Ripple STRING
  202.       lrtoggle WAVELENGTH FLOAT ZAMP FLOAT TRAVEL FLOAT RIPPLES U32
  203.     | EFFECT U32 frames Rotate20 STRING
  204.       xyzaxis DEGREES FLOAT
  205.     | EFFECT U32 frames Rotate2 STRING
  206.       xyzaxis DEGREES FLOAT
  207.     | EFFECT U32 frames Sway STRING
  208.       rxyzflag restrictflag GYRATIONS FLOAT FLOAT ANGLES FLOAT FLOAT SEED U32
  209.     | EFFECT U32 frames SPIKE STRING
  210.       lcrflag DISTANCE FLOAT FLOAT CYCLES FLOAT FLOAT DISPERSION FLOAT SEED U32
  211.       restrictflag reverseflag returnflag
  212.     | EFFECT U32 frames Tumble STRING
  213.       rzaxis ROTATIONS FLOAT FLOAT SEED U32
  214.  
  215. frames
  216.     : FRAMES U32 U32
  217.  
  218. xyz
  219.     : XYZ FLOAT FLOAT FLOAT
  220.  
  221. rgb
  222.     : RGB FLOAT FLOAT FLOAT
  223.  
  224. btl
  225.     : BTL FLOAT FLOAT FLOAT
  226.  
  227. v0v1
  228.     : VELOCITY FLOAT FLOAT
  229.  
  230. xyzaxis
  231.     : XAXIS
  232.     | YAXIS
  233.     | ZAXIS
  234.  
  235. rzaxis
  236.     : RANDOMAXIS
  237.     | ZAXIS
  238.  
  239. ucdsquash
  240.     : +SQUASH
  241.     | SQUASH
  242.     | -SQUASH
  243.  
  244. srlshape
  245.     : SPHERICAL
  246.     | RADIAL
  247.     | LINEAR
  248.  
  249. ppshape
  250.     : POINT
  251.     | PARALLEL
  252.  
  253. rrshape
  254.     :
  255.     | ROUND
  256.     | RECTANGULAR
  257.  
  258. radiustype
  259.     : INSCRIBE
  260.     | OUTSCRIBE
  261.     | AVERAGE
  262.     | RADIUS
  263.  
  264. sparkleflag
  265.     :
  266.     | SPARKLE
  267.  
  268. startflag
  269.     : STARTON
  270.     | STARTOFF
  271.  
  272. alignyflag
  273.     :
  274.     | ALIGNY
  275.  
  276. keepxflag
  277.     :
  278.     | KEEPX
  279.  
  280. mirrorflag
  281.     :
  282.     | MIRROR
  283.  
  284. reverseflag
  285.     :
  286.     | REVERSE
  287.  
  288. sharpflag
  289.     :
  290.     | SHARP
  291.  
  292. returnflag
  293.     :
  294.     | RETURN
  295.  
  296. lrtoggle
  297.     : LINEAR
  298.     | RADIAL
  299.  
  300. shadowflag
  301.     :
  302.     | SHADOW
  303.  
  304. diminishflag
  305.     :
  306.     | DIMINISH
  307.     | FALLOFF
  308.  
  309. yhorizontalflag
  310.     :
  311.     | YHORIZONTAL
  312.  
  313. gconformflag
  314.     :
  315.     | GCONFORM
  316.  
  317. oconformflag
  318.     :
  319.     | OCONFORM
  320.  
  321. quickdrawflag
  322.     :
  323.     | QUICKDRAW
  324.  
  325. splineflag
  326.     :
  327.     | SPLINE
  328.  
  329. knotflag
  330.     :
  331.     | KNOT
  332.  
  333. flareflag
  334.     :
  335.     | NOFLARE
  336.  
  337. dreflag
  338.     :
  339.     | DELAYED
  340.     | RAIN
  341.     | EMISSION
  342.  
  343. bounceflag
  344.     :
  345.     | BOUNCE
  346.  
  347. taperflag
  348.     :
  349.     | TAPER
  350.  
  351. lcrflag
  352.     : LINEAR
  353.     | CYLINDRICAL
  354.     | RADIAL
  355.  
  356. restrictflag
  357.     :
  358.     | RESTRICT
  359.  
  360. rxyzflag
  361.     : RANDOM
  362.     | XAXIS
  363.     | YAXIS
  364.     | ZAXIS
  365.  
  366.